cd /root/code/wedding-service
rm -rf source
GITLAB_TOKEN=PCRBvaxZ5ynyPS7FHNyh
git clone --depth 1  --branch test-sms https://oauth2:${GITLAB_TOKEN}@gitlab.datacanvas.com/ydyd/wedding-service.git ./source

cd ./source

JAVA_HOME=/opt/module/jdk-11.0.2

/opt/module/maven-3.8.8/bin/mvn clean package -DskipTests --settings /root/code/wedding-service/settings.xml

cd ..


echo """
# 
# FROM dockerproxy.cn/eclipse-temurin:11.0.24_8-jre-ubi9-minimal
# FROM dockerproxy.cn/alibabadragonwell/dragonwell:11.0.24.21.8-extended-ga-anolis
# docker pull dockerproxy.cn/alibabadragonwell/dragonwell:11.0.24.21.8-extended-ga-anolis
# docker pull dockerproxy.cn/eclipse-temurin:17.0.12_7-jre-ubi9-minimal

FROM dockerproxy.cn/eclipse-temurin:17.0.12_7-jre-ubi9-minimal
# 设置工作目录
WORKDIR /app

# 将构建好的 jar 文件复制到新的镜像中
COPY source/target/*.jar wedding-service.jar

# 挂载配置文件的目录
VOLUME /app/config

# 启动应用
CMD ["java", "-Dfile.encoding=UTF-8", "-Duser.timezone=GMT+08", "-Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true", "-jar", "wedding-service.jar", "--spring.config.location=/app/config/application.properties"]

""" > Dockerfile

docker build --no-cache --build-arg GITLAB_TOKEN=PCRBvaxZ5ynyPS7FHNyh -t tableagent-registry.cn-beijing.cr.aliyuncs.com/wedding/wedding-service:1.0.0 .


docker push tableagent-registry.cn-beijing.cr.aliyuncs.com/wedding/wedding-service:1.0.0